<template>
	<view class="layout">
		<view class="title">
			<text>title</text>
		</view>
		<view class="content">
			<view class="user">
				<text>发布人:{{props.listData.username}}</text>
				<text>时间:{{props.listData.time}}</text>
			</view>
			<view class="btn">
				<button type="primary" size="mini" @click="linkTo">详情</button>
			</view>
		</view>
	</view>
</template>

<script setup>
import dayjs from 'dayjs'
import { ref } from 'vue';
const props = defineProps({
	listData:{
		type:Object,
		default:()=>(
		{username:'张三',
		time:dayjs().format('YYYY-MM-DD/H:m:s'),
		url:'/pages/detail/detail'
		
		})
	}
})
const url = props.listData.url
const linkTo = function(){
	uni.navigateTo({
		url: url,
		success: res => { console.log(res); },
		fail: (e) => { console.log(e); },
		complete: (e) => { console.log(e); }
	});
}
</script>

<style lang="scss" scoped>
.layout{
	width: 100%;
	height: auto;
	padding: 15rpx 15rpx 0;
	background-color: white;
	.title{
		width: 100%;
		height: 60rpx;
		display: flex;
		justify-content: left;
		align-items: center;
		border-bottom: 1px solid #d4e4ff;
		
	}
	.content{
		width: 100%;
		height: auto;
		padding: 15rpx 0;
		.user{
			width: 100%;
			height: auto;
			display: flex;
			flex-direction: column;
			text{
				font-size: 25rpx;
				height: 40rpx;
				display: flex;
				justify-content: left;
				align-items: center;
			}
		}
		.btn{
			width: 100%;
			height: auto;
			
		}
	}
}
</style>